package a3;

public class Student {
    private String name;
    private Subject[] enrolledSubjects;
    private int subjectCount;

    public Student(String name) {
        this.name = name;
        this.enrolledSubjects = new Subject[5]; // 假设每个学生最多选5门课
        this.subjectCount = 0;
    }

    public void enrollInSubject(Subject subject) {
        if (subjectCount < 5) {
            enrolledSubjects[subjectCount++] = subject;
        }
    }
}
